package lt.liepasoft.locr.realization;

import java.util.Comparator;

import lt.liepasoft.locr.data.SymbolImage;


public class SymbolComparator implements Comparator<SymbolImage> {

	private SymbolImage mSymbolImage;
    
//	public SymbolComparator(){}
	
    public SymbolComparator(SymbolImage symbolImage) {
        this.mSymbolImage = symbolImage;
    }
     
    public void setSymbolImage(SymbolImage symbolImage){
    	this.mSymbolImage = symbolImage;
	}
    
    public SymbolImage getSymbolImage(){
    	return mSymbolImage;
    }
    
	@Override
	public int compare(SymbolImage symbolImage1, SymbolImage symbolImage2) {
		return SymbolRecognizer.similarityRate(
					mSymbolImage, symbolImage1
				).compareTo(
						SymbolRecognizer.similarityRate(
							mSymbolImage, symbolImage2
						)
				);
	}  
}
